gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\learning\unsuper\mln.m
function [logL] = mln(X,MI,SIGMA,Pk) % MLN logarithm of value of the likelihood function. % [logL] = mln(X,MI,SIGMA,Pk) % % MLN computes logarithm of value of the likelihood % function which is defined as product of probabilities p(x) of % all vectors from the point set X. It is considered that % conditional p.d. functions p(x|k) are normaly distributed % and their parameters are given. Futher, it is considered that % apriori probabilities p(k) are known, then the logarithm holds % N K % logL = sum log sum p(x_i|k) p(k) % i=1 k=1 % % % Input: % X [DxN] contains N vectors which are D-dimensional. % MI [DxK] contains K vectors of mean values, MI=[mi_1,mi_2,...mi_K]. % SIGMA [(DxD)xK] contains K covariance matrices which are D-by-D % dimensional, SIGMA=[sigma_1,sigma_2,...,sigma_K]. % The pair mi_1,sigma_1 describes the first normaly distributed % p.d. function p(x|k=1) and so one for k=1,2,...K. % Pk [1xK] contains K values of apriori probabilities. % % Output: % logL [1x1] logarithm of value of the Maximal-Likelihood function. % % See also UNSUNI, UNSUND, UNSUPER. % % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac % (c) Czech Technical University Prague, http://cmp.felk.cvut.cz % Written Vojtech Franc (diploma thesis) 4.8.2000 % Modifications D=size(MI,1); % dimension K=size(MI,2); % % of classes N=size(X,2); % # of points A=zeros(N,K); for k=1:K, pxk=normald(X,MI(:,k),SIGMA(:,1+(k-1)*D:k*D)); A(:,k)=pxk(:)*Pk(k); end logL=sum(log(sum(A,2)));